/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.vivo.dealer.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.vivo.dealer.entity.VivoWaresKind;
import com.vivo.dealer.dao.VivoWaresKindDao;

/**
 * 商品类别Service
 * @author jyangye
 * @version 2017-11-07
 */
@Service
@Transactional(readOnly = true)
public class VivoWaresKindService extends TreeService<VivoWaresKindDao, VivoWaresKind> {

	public VivoWaresKind get(String id) {
		return super.get(id);
	}
	
	public List<VivoWaresKind> findList(VivoWaresKind vivoWaresKind) {
		if (StringUtils.isNotBlank(vivoWaresKind.getParentIds())){
			vivoWaresKind.setParentIds(","+vivoWaresKind.getParentIds()+",");
		}
		return super.findList(vivoWaresKind);
	}
	
	@Transactional(readOnly = false)
	public void save(VivoWaresKind vivoWaresKind) {
		super.save(vivoWaresKind);
	}
	
	@Transactional(readOnly = false)
	public void delete(VivoWaresKind vivoWaresKind) {
		super.delete(vivoWaresKind);
	}
	
}